package com.puppet.controller;

import com.puppet.pojo.BookType;
import com.puppet.service.BookTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.security.auth.login.Configuration;
import java.util.List;

@RestController
@RequestMapping("/bookType")
@Api(tags = "图书类别接口")
public class BookTypeController {
    @Autowired
    private BookTypeService bookTypeService;

    @GetMapping("/findAll")
    @ApiOperation("获取所有图书类别")
    public ResponseEntity<?> findAll(){
        List<BookType> types = bookTypeService.findAll();
        return ResponseEntity.ok(types);
    }
}
